Point Methods

The Point object contains the following methods:

GetAttribute

The GetAttribute method returns a specified point attribute.

Syntax

GetAttribute(attrIdAsStringorEnum As Variant) As Variant

Parameters

Parameter Required Description

attrIdAsStringorEnum

Yes

A variant value (either a string or an enumeration) indicating the attribute to return. The enumeration table is "Enum CxScriptPointAttributes."

Remarks

The string name or enumeration value of an attribute can be used as the attrIdAsStringorEnum. See the CxScript Enumeration Attributes table in the Enumeration Constants section.

Example

The following function returns the point description for a given point tag using the Description attribute (0).

Copy
GetAttribute
Function GetPointDescription (tagString)
    Dim objPoint
     
    Set objPoint = Points.Point(tagString)
    GetPointDescription = objPoint.GetAttribute("Description")
End Function

Back to top

GetAttributeName

The GetAttributeName method returns an attribute name based on an attribute ID number.

Syntax

GetAttributeName(attrID As Long) As Variant

Parameters

Parameter Required Description

attrId

Yes

The ID of the attribute. Attributes are listed in "Enum CxScriptPointAttributes."

Remarks

A typical use of this function is looping through a set of attributes by ID and displaying the attribute name with its value for a particular tag. See the CxScript Enumeration Attributes table in the Enumeration Constants section.

Example

The following function loops through the first seven point attributes for a PSTATIC point and displays each value in a list box.

Copy
GetAttributeName
Sub ShowPointAttributes ()
    Dim objPoint, strAttrName, strLine
    lstFacilities.ResetContent
     
    'Create a point object based on the facility/UDC tag string
    Set objPoint = Points.Point("CYGDEMO.UIS::METER206.PSTATIC")
     
    For i = 0 To 6
        strAttrName = objPoint.GetAttributeName(i)
        objPoint.GetAttribute(i)
        lstFacilities.AddString strLine
    Next
End Sub

Back to top